package com.dys.rowmapper.impl;

import com.dys.entity.Account;
import com.dys.rowmapper.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author: 疾风
 * @ClassName: AccountRowMapper
 * @Description: 具体的Dao中使用DaoUtils的公共查询方法，需要将RowMapper做对应的实现
 * @CreateDate: 2024/09/14
 * @Version: v1.0.0
 */
public class AccountRowMapper implements RowMapper<Account> {
    @Override
    public Account rowMapper(ResultSet rs) throws SQLException {
        Account account = new Account();
        account.setId(rs.getInt("id"));
        account.setCardNo(rs.getString("card_no"));
        account.setName(rs.getString("name"));
        account.setPassword(rs.getString("password"));
        account.setMoney(rs.getBigDecimal("money"));
        return account;
    }
}
